package org.learn.dataguru.kafka.demo.class05;

import java.io.IOException;

import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;

public class ZkUtil {
	
	private static final int TIMEOUT = 3000;
	
	ZooKeeper zkp = null;
	
	public ZkUtil() throws IOException{
		zkp = new ZooKeeper("192.168.137.130:2181", TIMEOUT, new Watcher(){

			@Override
			public void process(WatchedEvent event) {
				System.out.println("State:"+event.getState());
			}
			
		});
	}

	public ZooKeeper getZkp() {
		return zkp;
	}

}
